package org.tacademy.and12th.jyh.buckeybuckey;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

public class FullBadgeDialog extends DialogFragment {
	
//	private View v;
//	public Integer[] BadgeTextIds = {
//			R.string.badge_follow_string, R.string.badge_love_string,
//			R.string.badge_n_tower_string, R.string.badge_pizza_string,
//			R.string.badge_xmas_string
//			};
	//String BadgeSubtext [] = { };

	public static int currentIdx = 0;
	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState) {
	    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
	    // Get the layout inflater
	    LayoutInflater inflater = getActivity().getLayoutInflater();
	    

	    View root = inflater.inflate(R.layout.badge_full_dialog, null);
	    ImageView BadgeFull = (ImageView) root.findViewById(R.id.imageView1);
	    TextView BadgeText = (TextView) root.findViewById(R.id.BadgeText);
 
	    BadgeFull.setImageResource(BadgeImageAdapter.BadgeThumbIds[currentIdx]);
	    BadgeFull.setVisibility(View.VISIBLE);
	    BadgeText.setText(BadgeImageAdapter.BadgeTextIds[currentIdx]);
	    
	    builder.setView(inflater.inflate(R.layout.badge_full_dialog, null))
	    		.setTitle(R.string.badge_info)
	           .setNegativeButton(R.string.badge_ok, new DialogInterface.OnClickListener() {
	               public void onClick(DialogInterface dialog, int id) {
	                   FullBadgeDialog.this.getDialog().cancel();
	               }
	           });
	    
	    builder.setView(root);
	    return builder.create();
	  
	    
	    }

}
//v = inflater.inflate(R.layout.badge_full_dialog, (ViewGroup) v.findViewById(R.id.root));
//
//BadgeFull = (ImageView)v.findViewById(R.id.imageView1);
//BadgeFull.setImageResource(R.drawable.badge_pizza);
//BadgeFull.setVisibility(View.VISIBLE);

// Inflate and set the layout for the dialog
// Pass null as the parent view because its going in the dialog layout
